Skip to content

Dynamic campaign audience - #2695

Open
adelowo wants to merge 2 commits into
mainfrom
feat-ISS-2676
Open

Dynamic campaign audience#2695
adelowo wants to merge 2 commits into
mainfrom
feat-ISS-2676

Conversation

@adelowo

@adelowo adelowo commented Aug 11, 2026

Copy link
Copy Markdown
Member

Dynamic audience

mutation($input: CreateAudienceInput!) {
  createAudience(input: $input) {
    audience {
      id
      audienceType
    }
  }
}

  {
    "input": {
      "name": "All Contacts with an existing email",
      "description": "All contacts with an email address",
      "audienceType": "DYNAMIC",
      "filters": {
        "selectors": [
          {
            "schema": "contact",
            "where": "target.email != ''"
          }
        ]
      }
    }
  }
  {
    "input": {
      "name": "Openlane and Google Contacts",
      "description": "Contacts at Openlane or Google Cloud",
      "audienceType": "DYNAMIC",
      "filters": {
        "selectors": [
          {
            "schema": "contact",
            "expression": "target.company == 'Openlane'"
          },
          {
            "schema": "contact",
            "expression": "target.company == 'Google Cloud'"
          }
        ]
      }
    }
  }

Manual audience where they are defined upfront


mutation($input: CreateAudienceMemberInput!) {
  createAudienceMember(input: $input) {
    audienceMember {
      id
    }
  }
}

{
  "input": {
    "audienceType" : "MANUAL" or dynamc,
    "name": "Employee group 1",
    "description" : "employees of fictional company"
  }
}

@github-actions github-actions Bot removed the cli label Aug 24, 2026
@adelowo
adelowo force-pushed the feat-ISS-2676 branch 2 times, most recently from 2c45fcf to 81eb643 Compare August 24, 2026 21:53
@adelowo
adelowo marked this pull request as ready for review August 26, 2026 10:54
@adelowo
adelowo requested a review from a team as a code owner August 26, 2026 10:54
@adelowo adelowo changed the title Dynamic campagain audience Dynamic campaign audience Aug 26, 2026
Comment thread fga/model/generated/crud.fga
Comment thread fga/model/automation/assessments.fga
Comment on lines +70 to +73
field.String("email").
Comment("the email address for this audience member").
NotEmpty().
Annotations(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why doe this have to be not empty? Can't it be from one of the edges?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can do that but I opted for this for 2 reasons:

  • I'd suppose I will want to have a view of those I sent the campaign to later on. if we update the email of an identity_holder/contact for some reason, we may lose the original one we have
  • will get more complex where we have to track which schema has the id

Comment thread internal/ent/hooks/audience.go
Comment thread internal/integrations/definitions/email/audience_targets.go
@adelowo
adelowo enabled auto-merge (squash) August 28, 2026 18:31
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
12.3% Coverage on New Code (required ≥ 20%)

See analysis details on SonarQube Cloud

@github-actions github-actions Bot removed the cli label Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants